In this paper we consider the numerical computation of the optimal cost
function associated to the problem that consists in finding the minimum of
the maximum of a scalar functional on a trajectory. We present an
approximation method for the numerical solution which employs both
discretization on time and on spatial variables. In this way, we obtain a
fully discrete problem that has unique solution. We give an optimal estimate
for the error between the approximated solution and the optimal cost
function of the original problem. Also, numerical examples are presented.